input_file_path = "2024 单词.txt"   # 输入文件路径
output_file_path = "output.txt" # 输出文件路径

# 读取输入文件
with open(input_file_path, "r") as input_file:
    content = input_file.read()

# 将回车换行符替换为空格
content_without_newlines = content.replace("\n", " ")

# 将修改后的内容写入输出文件
with open(output_file_path, "w") as output_file:
    output_file.write(content_without_newlines)

print("回车换行已替换为空格并写入输出文件。")
